Skip to content

Conversation

@robqduquette
Copy link

Fixed a bug where oPointsDummyFunc would pick the wrong points and end up extrapolating from them instead of picking the right points and interpolating.

Eg, when interpolation should happen between x1 and x2, it would instead extrapolate between x2 and x3.
In the diagram below, when trying to interpolate at input Z(x), we would end up with Z*(x)

 Z
 ^             Z*
 |              \
 |      x1---Z--x2
 |                \
 |                 \
 |                  x3
 |
 +------------------------------> x

For another example, here is a desired modulation on a BaseCylinder for a pulley:

List<Vector3> aPoints = new List<Vector3>(){
    new Vector3(0f,     0f, fRad),
    new Vector3(fTransition,  0f, fRad),
    new Vector3(0.5f,   0f, fRadIn),
    new Vector3(1f - fTransition,  0f, fRad),
    new Vector3(1f,     0f, fRad)
};
LineModulation oPulleyShape = new LineModulation(aPoints, LineModulation.ECoord.Z, LineModulation.ECoord.X);

Previously this would result in an object like this:
image

Now this results in the intended shape:
image

… would extrapolate from the next two points instead of interpolate between the current two.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant